<div id="content">
  <div class="row s_page_title">
    <sa-big-breadcrumbs [items]="['供应链管理','生产采购管理','采购申请明细']" icon="fa fa-cogs" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
  </div>

  <sa-widgets-grid>
    <div class="s_table">
      <div sa-widget [editbutton]="false" color="darken" class="clearfix">
        <header>
          <span class="widget-icon"> <i class="fa fa-table"></i> </span>
          <h2>采购申请明细</h2>
        </header>
        <div>
          <div class="widget-body no-padding">
            <div class="page-header clearfix s_table_opreation">
                <div class="left page-header-btn" style="width: calc(100% - 220px);">
                  <div class="selectDate top_module modify_border">
                    <span class="module_text">申请日期</span>
                      <table-select-date [notInit]='true' [minDay]='true' [specifyId]='specifyId' (outerTime)="getSelectTableTime($event)" [specifyTime]='specifyTime'></table-select-date>
                    </div>
                    <div class="top_module top_module_box" style="min-width: auto;">
                      <span class="top_module_label module_text">申请类型</span>
                      <select name="" class="top_module_select" [(ngModel)]="buyApplyType" style="min-width: 110px;">
                        <option value="">全部</option>
                        <option value="1">例行采购(授权数额内)</option>
                        <option value="2">例行采购(授权数额外)</option>
                        <option value="3">例外采购</option>
                        <option value="4">损伤增补</option>
                        <option value="5">遗失增补</option>
                        <option value="6">紧急采购</option>
                      </select>
                    </div>
                    <div class="top_module cancle">
                      <span class="module_text">物料编码</span>
                      <input type="text" class="module_inp top_module_select ng-pristine ng-valid ng-touched" placeholder="物料编码" [(ngModel)]='materialNumber'>
                      <div class="s_del_icon" (click)='delKey("materialNumber")'>x</div>
                    </div>
                    <div class="top_module cancle">
                      <span class="module_text">物料名称</span>
                      <input type="text" class="module_inp top_module_select ng-pristine ng-valid ng-touched" placeholder="物料名称" [(ngModel)]='materialName'>
                      <div class="s_del_icon" (click)='delKey("materialName")'>x</div>
                    </div>
                    <div class="top_module cancle">
                      <span class="module_text">交货地址</span>
                      <input type="text" class="module_inp top_module_select ng-pristine ng-valid ng-touched" placeholder="交货地址" [(ngModel)]='deliveryAddress'>
                      <div class="s_del_icon" (click)='delKey("deliveryAddress")'>x</div>
                    </div>
                    <div class="top_module cancle">
                      <span class="module_text">申请部门</span>
                      <input type="text" class="module_inp top_module_select ng-pristine ng-valid ng-touched" placeholder="申请部门" [(ngModel)]='applyDepartmet '>
                      <div class="s_del_icon" (click)='delKey("applyDepartmet")'>x</div>
                    </div>
                    <div class="top_module cancle">
                      <span class="module_text">申请人</span>
                      <input type="text" class="module_inp top_module_select ng-pristine ng-valid ng-touched" placeholder="申请人" [(ngModel)]='applicant'>
                      <div class="s_del_icon" (click)='delKey("applicant")'>x</div>
                    </div>
                    <button class="btn btn-primary" (click)="table_search()">查询</button>
                    <button type="button" class="btn btn-primary" (click)="exportData()">导出</button>
                </div>
                <!-- <div class="right top-search">
                    <input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="车牌号/公司名称/维修编号">
                    <span class="top-search-box">
                        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
                    </span>
                </div> -->
            </div>
            <div class="table_scroll">
                <table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                    <thead>
                        <tr>
                            <th>采购申请编号</th>
                            <th>申请日期</th>
                            <th>申请类型</th>
                            <th>物料编码</th>
                            <th>物料名称</th>
                            <th>型号规格</th>
                            <th>单位</th>
                            <th>数量</th>
                            <th>要求到货日期</th>
                            <th>交货地址</th>
                            <th>备注</th>
                            <th>申请部门</th>
                            <th>申请人</th>
                            <th>创建时间</th>
                            <th>创建人</th>
                            <th>更新时间</th>
                            <th>更新人</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr *ngFor="let row of tableData; let i = index" [attr.data-index]="i">
                            <td>{{row.buyApplyNumber}}</td>
                            <td>{{row.applyDate}}</td>
                            <td>
                              <span *ngIf="row.buyApplyType == 1">例行采购(授权数额内)</span>
                              <span *ngIf="row.buyApplyType == 2">例行采购(授权数额外)</span>
                              <span *ngIf="row.buyApplyType == 3">例外采购</span>
                              <span *ngIf="row.buyApplyType == 4">损伤增补</span>
                              <span *ngIf="row.buyApplyType == 5">遗失增补</span>
                              <span *ngIf="row.buyApplyType == 6">紧急采购</span>
                            </td>
                            <td>{{row.materialNumber}}</td>
                            <td>{{row.materialName}}</td>
                            <td>{{row.specification}}</td>
                            <td>{{row.units}}</td>
                            <td>{{row.count}}</td>
                            <td>{{row.askDeliveryDate}}</td>
                            <td>{{row.deliveryAddress}}</td>
                            <td>{{row.remark}}</td>
                            <td>{{row.applyDepartmet}}</td>
                            <td>{{row.applicant}}</td>
                            <td>{{row.createTime}}</td>
                            <td>{{row.createName}}</td>
                            <td>{{row.updateTime}}</td>
                            <td>{{row.updateName}}</td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="table-fix clearfix">
                <paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1" (onPageChange)="paginate($event)">
                </paginator>
                <button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </sa-widgets-grid>

</div>

<style>
  .cancle{
      position: relative;
  }
  .cancle:hover>.s_del_icon{
      display: inline-block;
  }
  </style>